<meta charset="utf-8"/>
<?php

//采集百度数据

//初始化
$curl = curl_init();
//路径
$url = "http://www.baidu.com";
//
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
//$str = '这是我获取的百度源代码';
//发送请求,得到网页的源代码
$str = curl_exec($curl);

// echo $str;

$pic ="//";//
preg_match($pic, $str,$arr);

print_r($arr);

//关闭
curl_close($curl);

